package com.bw.day_2

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.launcher.ARouter
import com.bw.base.mvvm.BaseViewActivity
import com.bw.day_2.databinding.ActivityWoBinding
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
@AndroidEntryPoint
class WoActivity : BaseViewActivity<ActivityWoBinding>() {

    override fun initView() {
        lifecycleScope.launch {
            for (i in 5 downTo  0){
                delay(1000)
                binding.tv.setText("${i}")
                if (i == 0){
                    ARouter.getInstance().build("/app/LoginActivity").navigation()
                }
            }
        }
        binding.tv.setOnClickListener {
            finish()
            ARouter.getInstance().build("/app/LoginActivity").navigation()
        }

    }

    override fun initData() {

    }
}